import { Device } from "@/api/interface/iot";
import http from "@/api";
import { ResPage } from "@/api/interface/index";

/**
 * @name 硬网关管理模块
 */

export const getRuleList = (params: Device.ReqRule) => {
	return http.get<ResPage<Device.ResRule[]>>(`/rule/find`, params);
};
export const getRule = (params: Device.ResRule) => {
	return http.get<Device.ResRule>(`/rule/get`, params);
};
export const addRule = (params: Device.ResRule) => {
	return http.post(`/rule/add`, params);
};
export const delRule = (params: Device.ResRule) => {
	return http.post(`/rule/remove`, params);
};
export const modRule = (params: Device.ResRule) => {
	return http.post(`/rule/modify`, params);
};
export const enableRule = (params: Device.ResRule) => {
	return http.post(`/rule/enable`, params);
};
export const disableRule = (params: Device.ResRule) => {
	return http.post(`/rule/disable`, params);
};
export const getRuleProcessorList = (params: Device.ReqRule) => {
	return http.get<ResPage<Device.ResRule[]>>(`/rule/processor/find`, params);
};
export const getRuleProcessor = (params: Device.ResRule) => {
	return http.get<Device.ResRule>(`/rule/processor/get`, params);
};
export const addRuleProcessor = (params: Device.ResRule) => {
	return http.post(`/rule/processor/add`, params);
};
export const delRuleProcessor = (params: Device.ResRule) => {
	return http.post(`/rule/processor/remove`, params);
};
export const modRuleProcessor = (params: Device.ResRule) => {
	return http.post(`/rule/processor/modify`, params);
};
